import getProlist from '../api/getProlist'
import regFn from "../api/reg"
import loginFn from "../api/login"
import goodsDetail from "../api/goodsDetail"
const actions={
	getPro({commit}){
		getProlist({params:{uid:19802}}).then(data=>{
			commit("getgoods",{
				arr:data.data.data
			})
		})
	},
	getShop({commit}){
		getProlist({params:{uid:26038}}).then(data=>{
			commit("getshop",{
				arr:data.data.data
			})
		})
	},
	getDetail({commit},{pid}){
		goodsDetail({params:{id:pid}}).then(data=>{
			commit("getdetails",{
				obj:data.data.data
			})
		})
	},
	 getUser({commit},userObj){
		 regFn({params:{username:userObj.username,password:userObj.password}}).then(data=>{
			 commit("getusers",{
				 obj:data.data.msg
			 })
		 })
	 },
	 getloginmsg({commit},userObj){
	 		 loginFn({params:{username:userObj.username,password:userObj.password}}).then(data=>{
	 			 commit("getlogins",{
	 				 uobj:data.data
	 			 })
	 		 })
	 },
	 
	 
}

export default actions